@extends('layouts.mobile')

@section('title', '订单详情')

@section('content')
    <div class="order-detail">
        <div class="order-header">
            @if ($order['trade_status'] == 1)
                <div class="order-status">
                    <strong>等待买家付款</strong>
                </div>
                <img src="{{asset('images/trade/waitPay.png')}}" class="status-icon">
            @endif
            @if ($order['trade_status'] == 2)
                <div class="order-status">
                    <strong>等待卖家发货</strong>
                </div>
                <img src="{{asset('images/trade/waitSend.png')}}" class="status-icon">
            @endif
            @if ($order['trade_status'] == 3)
                <div class="order-status">
                    <strong>卖家已发货</strong>
                </div>
                <img src="{{asset('images/trade/send.png')}}" class="status-icon">
            @endif
            @if ($order['trade_status'] == 4)
                <div class="order-status">
                    <strong>交易成功</strong>
                </div>
                <img src="{{asset('images/trade/received.png')}}" class="status-icon">
            @endif
        </div>
        <div class="address" style="margin: 0;">
            <div class="iconfont icon-location"></div>
            <div class="info">
                <p style="display: flex;">
                    <span style="flex: 1;">收货人:{{$shipping['consignee']}}</span>
                    <span>联系电话:{{$shipping['phone']}}</span>
                </p>
                <p>收货地址:{{$shipping['province']}} {{$shipping['city']}} {{$shipping['district']}} {{$shipping['street']}}</p>
            </div>
        </div>

        <div class="order-info">
            <div class="items">
                @foreach ($items as $item)
                    <div class="item">
                        <div class="image bg-cover" style="background-image: url({{image_url($item['thumb'])}})"></div>
                        <div class="name">
                            <h3>{{$item['title']}}</h3>
                        </div>
                        <div class="attrs">
                            <p>￥{{$item['price']}}</p>
                            <p>x{{$item['quantity']}}</p>
                        </div>
                    </div>
                @endforeach
            </div>
            <div class="groups">
                <div class="group">
                    <div class="label-name">订单编号</div>
                    <div class="label-text">{{$order['order_no']}}</div>
                </div>
                <div class="group">
                    <div class="label-name">下单时间</div>
                    <div class="label-text">{{@date('Y-m-d H:i:s', $order['created_at'])}}</div>
                </div>
                <div class="group">
                    <div class="label-name">订单金额</div>
                    <div class="label-text">{{$order['total_fee']}}</div>
                </div>
                <div class="group">
                    <div class="label-name">付款方式</div>
                    <div class="label-text">
                        @if ($order['pay_type'] == 1)
                            在线支付
                        @else
                            货到付款
                        @endif
                    </div>
                </div>
                @if ($order['pay_type'] == 1)
                <div class="group">
                    <div class="label-name">交易流水</div>
                    <div class="label-text">{{$order['trade_no']}}</div>
                </div>
                @endif
                <div class="group">
                    <div class="label-name">买家账号</div>
                    <div class="label-text">{{$order['buyer_name']}}</div>
                </div>
            </div>
        </div>
    </div>
@stop
